<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Fecth RESTFul</title>
  </head>

  <body>
    <script>
      //1. 传统的get传参数的方式
      //根据id值查询员工的信息
      fetch("http://localhost:3000/json/2", {
        method: "get",
      })
        .then((data) => data.text())
        .then((data) => void console.log(JSON.parse(data)));

       
    </script>
  </body>
</html>
